package mysql

import "gorm.io/gorm"

// Goods 商品表
type Goods struct {
	gorm.Model
	Name  string  `gorm:"type:varchar(20);not null;"`
	Price float64 `gorm:"type:decimal(10,2);not null;"`
	Stock int     `gorm:"type:int(5);not null;comment:商品数量"`
}

func (g *Goods) Create() error {
	return DB.Create(&g).Error
}
